package com.zhixue.controller;

import com.zhixue.model.po.Dictionary;
import com.zhixue.system.service.DictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Auther: 李 力
 * @Date: 2025/4/7
 * @Description: com.zhixue.controller
 * @version: 1.0
 */
@RestController
@RequestMapping
public class DictionaryController {

    @Autowired
    private DictionaryService dictionaryService;

    @GetMapping("/dictionary/all")
    public List<Dictionary> queryAll() {
        return dictionaryService.queryAll();
    }

    @GetMapping("/dictionary/code/{code}")
    public Dictionary getByCode(@PathVariable String code) {
        return dictionaryService.getByCode(code);
    }

}
